package com.retailers.generator;


import com.retailers.generator.bean.TableBean;
import com.retailers.generator.service.MybatisGenService;
import lombok.extern.slf4j.Slf4j;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest
public class BaseController {

    public MockMvc mockMvc;

    @Autowired
    private MybatisGenService genService;


    @Autowired
    private WebApplicationContext webApplicationContext;

    @Before
    public void setup() { this.mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build(); }

    @Test
    public void creatRpImageUseGraphics() throws Exception {
        List<TableBean> list=genService.tablesList();
        for (TableBean stringObjectMap : list) {
            System.out.println();
//            for (String s : stringObjectMap.keySet()) {
//                System.out.println(s+"---->"+stringObjectMap.get(s));
//            }
        }
    }

    @Test
    public void genCode() throws Exception {
        List<String> list=new ArrayList<>();
        list.add("tp_meituan_rp");
//        genService.genCode(list);

    }
}
